Skip to content

Add Azure Linux 4.0 PXE boot support for LiveOS images#826

Open
vinceaperri wants to merge 2 commits into
mainfrom
user/vinceaperri/image-customizer-azl4-iso-pxe
Open

Add Azure Linux 4.0 PXE boot support for LiveOS images#826
vinceaperri wants to merge 2 commits into
mainfrom
user/vinceaperri/image-customizer-azl4-iso-pxe

Conversation

@vinceaperri

@vinceaperri vinceaperri commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

A PXE-booted Azure Linux 4.0 image stopped at an empty grub menu, because AZL4 uses BLS (Boot Loader Specification) boot entries that grub cannot enumerate over TFTP. This change expands those BLS Type #1 entries into explicit grub menuentry blocks when the PXE artifacts are built, so netboot works without grub reading boot/loader/entries over TFTP. It is wired per distro through a new DistroHandler.UpdateLiveOSGrubCfgForPxe hook plus a shared BLS renderer, so other BLS distros benefit too.

Tests (in support of the above) — test_pxe.py adds bootstrap and full-OS PXE boot tests for AZL3 and AZL4 over a transient libvirt NAT network (dnsmasq DHCP and TFTP) plus an HTTP server over the extracted artifacts (pxe_server.py). They are skipped on Azure Linux hosts, whose edk2-ovmf lacks the UEFI network stack (EDK II NetworkPkg) and cannot netboot a VM, and run on Ubuntu hosts.

@vinceaperri vinceaperri requested a review from a team as a code owner July 6, 2026 18:16
@vinceaperri vinceaperri force-pushed the user/vinceaperri/image-customizer-azl4-iso-pxe branch 2 times, most recently from 9a9cc4e to 6f4390e Compare July 6, 2026 18:37
@vinceaperri vinceaperri changed the title Add PXE boot support and VM tests for LiveOS images Add Azure Linux 4.0 PXE boot support for LiveOS images Jul 6, 2026
Comment thread test/vmtests/vmtests/utils/pxe_server.py Outdated
Comment thread test/vmtests/vmtests/utils/pxe_server.py Outdated
Add PXE (network) boot support for Azure Linux 4.0 LiveOS images.

Azure Linux 4.0 boots via BLS (Boot Loader Specification) entries under
boot/loader/entries, which grub cannot enumerate over TFTP, so a
PXE-booted AZL4 image reached an empty grub menu. This expands the BLS
Type #1 entries into explicit grub menuentry blocks when the PXE
artifacts are built, so netboot works without grub reading the entries
directory over TFTP. It is wired per distro through a new
DistroHandler.UpdateLiveOSGrubCfgForPxe hook plus a shared BLS renderer,
so other BLS distros benefit too.

Tests (in support of the above): test_pxe.py adds bootstrap and full-OS
PXE boot tests for AZL3 and AZL4 over a transient libvirt NAT network
(dnsmasq DHCP and TFTP) plus an HTTP server over the extracted artifacts
(pxe_server.py). They are skipped on Azure Linux hosts, whose edk2-ovmf
lacks the UEFI network stack (EDK II NetworkPkg) and cannot netboot a VM,
and run on Ubuntu hosts.
- Run the PXE HTTP server via multiprocessing.Process instead of a python -m http.server subprocess.
- Extract PXE artifacts into a world-traversable /var/tmp directory and drop the chmod of ancestor directories.
@vinceaperri vinceaperri force-pushed the user/vinceaperri/image-customizer-azl4-iso-pxe branch from 6f4390e to 629c170 Compare July 6, 2026 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants